<template>
    <div class="app-container">
        <el-form inline>
            <el-form-item label="客户编号">
                <el-input placeholder="客户编号"></el-input>
            </el-form-item>
            <el-form-item label="客户名称">
                <el-input placeholder="客户名称"></el-input>
            </el-form-item>
            <el-form-item label="客户状态">
                <el-input placeholder="客户状态"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary"
                           icon="el-icon-search"
                           size="mini"
                           @click="handleQuery">搜索</el-button>
                <el-button icon="el-icon-refresh"
                           size="mini"
                           @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-form>
        <el-table>
            <el-table-column type="selection"
                             width="55"></el-table-column>
            <el-table-column label="客户编号"></el-table-column>
            <el-table-column label="客户名称"></el-table-column>
            <el-table-column label="客户类型"></el-table-column>
            <el-table-column label="客户来源"></el-table-column>
            <el-table-column label="状态"></el-table-column>
        </el-table>

        <pagination v-show="total>0"
                    :total="total"
                    :page.sync="queryParams.pageNum"
                    :limit.sync="queryParams.pageSize"
                    @pagination="getList" />
    </div>
</template>

<script>
export default {
    data() {
        return {
            // 总条数
            total: 0,
            queryParams: {
                pageNum: 1,
                pageSize: 10,
            },
        };
    },
    created() {
        this.getList();
    },
    methods: {
        getList() {
            this.loading = true;
        },
        /** 搜索按钮操作 */
        handleQuery() {
            this.queryParams.pageNum = 1;
            this.getList();
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.resetForm("queryForm");
            this.handleQuery();
        },
    },
}
</script>
